<?php
	final class Database {
		
		private $db =null;
		private $inflector = null;
		
		public function __construct() {
		$this->db = new PDO("pgsql:dbname=pruebas;host=localhost", USER, PASS );
		}
		
		public function select($cond = null, $fields = null, $table) {
			$query = "SELECT ";
			if (is_null($fields)) $query .=" * ";
			else $query .= " ".$fields;
			$query .= " FROM ".$table;
			if (!is_null($cond)) $query .= " WHERE ".$cond;
			$query .= ";";
			
			$statement = $this->db->prepare($query);
			$statement->execute();
			$result = $statement->fetchAll(PDO::FETCH_ASSOC);
			return $result;
		}
	}